import request from './config'

// 简历质量评分相关接口类型定义
export interface DetailItem {
  category: string
  detailDesc: string
  errorCode: string
  extendDesc: string | null
  path: string
  subCategory: string
}

export interface ModuleGroup {
  detailList: DetailItem[]
  moduleRuleDescription: string
  score: number
}

export interface CategoryDetail {
  categoryDescription: string
  moduleGroupList: ModuleGroup[]
  remainingScore: number
}

export interface QualityScoreResult {
  detailList: CategoryDetail[]
  totalScore: string
}

export interface QualityScoreResponse {
  code: number
  data: QualityScoreResult
  message: string
  taskId: string
  time: string
}

// 简历质量评分相关接口
export const calculateQualityScore = (params: { resumeNumber: string; userId: string }): Promise<QualityScoreResponse> => {
  return request.get('/qualityCalculate/calculateQuality', {
    params
  })
}

// 简历预览相关接口
export const previewResume = (params: { resumeNumber: string; lang: number }) => {
  return request.get('/nodeget/previewNoUserId', {
    params
  })
}